package com.itany.controller;


import com.github.pagehelper.PageInfo;
import com.itany.pojo.Examine;
import com.itany.service.ExamineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@Controller
@RequestMapping("/examine")
public class ExamineController {

    @Autowired
    private ExamineService examineService;


    @RequestMapping("/findAll")
    @ResponseBody
    public Object findAll(Examine examine,Integer pageNum,Integer pageSize){
        PageInfo<Examine> all=examineService.findAll(examine,pageNum,pageSize);
        HashMap map=new HashMap<String,String>();
        map.put("total",all.getTotal());
        map.put("rows",all.getList());
        return map;
    }
}
